﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using B.S.Production.Domain.Entities;
using SqlSugar;

namespace B.S.Production.Infrastructure
{
    public class DbContext
    {
        public SqlSugarClient Db {  get; set; }
        public DbContext()
        {
            Db = new SqlSugarClient(new ConnectionConfig()
            {
                ConnectionString = "server=10.223.8.6;database=PNB;uid=sa;pwd=123456;Trust Server Certificate=True",
                DbType = SqlSugar.DbType.SqlServer,
                IsAutoCloseConnection = true,//自动关闭连接""
                InitKeyType = InitKeyType.Attribute,//使用实体类中的注释来初始化
            });
        }
    }
}
